package cn.edu.ctbu.firstdata.service;

import cn.edu.ctbu.firstdata.domain.Student;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;


import java.util.List;

public interface IStudentService {
    public List<Student> getall();
    public Page<Student> getall(Pageable pageable);
    public List<Student> getall(Example<Student> example);
    public List<Student> findByName(String studentName);
    public List<Student> findByNameLike(String studentName);
    public Student findById(Integer id);
    public List<Student> getStudentScoreLess(Integer score);

    /**
     * 新增和更新单个学生
     * @param student
     * @return
     */
    public Student save(Student student);

    public void delete(Integer id);
    public void delete(Student student);
    /**
     * 支持分页的找出所有学生
     * @param pageable
     * @return
     */
    public Page<Student> findAll(Pageable pageable);
    /**
     * 按性别查询，并分页
     * @param sex
     * @param pageable
     * @return
     */
    public Page<Student> findBySex(Integer sex,Pageable pageable);

    public boolean validUserNameAndPassword(String userName,String password) throws Exception;
}
